#pragma once 

#ifndef ANIMATIONPLAYER_H
#define ANIMATIONPLAYER_H

#include<map>
#include<string>
#include "EntityManager.h"
#include "MessageHandler.h"
#include <d3d9.h>
#include <d3dx9.h>
#include "Entity.h"
#include "Animation.h"
#pragma comment(lib, "d3d9.lib")
#pragma comment(lib, "d3dx9.lib")

class AnimationPlayer
{
private:
	Animation* currentAnimation;
	std::string playing;
	std::map<std::string, Animation*> animations;
	int frameIndex;
	float time;
public:
	AnimationPlayer();
	~AnimationPlayer();
	void addAnimation(std::string name, Animation* anim);
	void playAnimation(std::string name);
	void update(float frameTime);
	void draw(ID3DXSprite* spriteBatch, D3DXVECTOR3 position, D3DXMATRIX transform);
	Animation* getCurrentAnimation() const {return currentAnimation; }
	std::string getPlaying() const {return playing; }
	int getFrameIndex() const {return frameIndex; }

};

#endif 